// @ts-ignore
/* eslint-disable */
import request from "@/request.ts";

/** getFamilyById GET /family */
export async function getFamilyById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getFamilyByIdUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseFamily_>("/family", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** updateFamilyName PUT /family */
export async function updateFamilyName(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.updateFamilyNameUsingPUTParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseFamily_>("/family", {
    method: "PUT",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** createFamily POST /family */
export async function createFamily(
  body: API.FamilyRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseFamily_>("/family", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** getAllFamilyMembers GET /family/member */
export async function getAllFamilyMembers(options?: {
  [key: string]: any;
}) {
  return request<API.BaseResponseListFamilyMember_>("/family/member", {
    method: "GET",
    ...(options || {}),
  });
}

/** updateFamilyMember PUT /family/member */
export async function updateFamilyMember(
  body: API.FamilyMemberRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseFamilyMember_>("/family/member", {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** addFamilyMember POST /family/member */
export async function addFamilyMember(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.addFamilyMemberUsingPOSTParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseFamilyMember_>("/family/member", {
    method: "POST",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** deleteFamilyMember DELETE /family/member */
export async function deleteFamilyMember(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteFamilyMemberUsingDELETEParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseString_>("/family/member", {
    method: "DELETE",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** searchFamiliesByName GET /family/search */
export async function searchFamiliesByName(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.searchFamiliesByNameUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseListFamily_>("/family/search", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
